home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 August: Tool Chest / Apple_Developer_Group_August_1996_Tool_Chest.iso / Sample Code / Snippets / Files / Select Folder w⁄ Gray files / simple.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-07  |  2.4 KB  |  66 lines  |  [TEXT/MPS ]

  1. #include <Types.h>
  2. #include <memory.h>
  3. #include <Packages.h>
  4. #include <Errors.h>
  5. #include <quickdraw.h>
  6. #include <fonts.h>
  7. #include <dialogs.h>
  8. #include <windows.h>
  9. #include <menus.h>
  10. #include <events.h>
  11. #include <OSEvents.h>
  12. #include <Desk.h>
  13. #include <diskinit.h>
  14. #include <OSUtils.h>
  15. #include <resources.h>
  16. #include <toolutils.h>
  17. #include <AppleEvents.h>
  18. #include <EPPC.h>
  19. #include <GestaltEqu.h>
  20. #include <PPCToolbox.h> 
  21. #include <Processes.h>
  22. #include <Balloons.h>
  23. #include <aliases.h>
  24. typedef void (*myDrawProcPtr)(WindowPtr theWindow); 
  25. typedef void (*myClickProcPtr)(WindowPtr theWindow,EventRecord *theEvent); 
  26. typedef void (*windowSaveProc)(WindowPtr theWindow); 
  27. typedef void (*myCloseProcPtr)(WindowPtr theWindow); 
  28. typedef void (*mySizeProcPtr)(WindowPtr theWindow,short how); 
  29. typedef void (*myActivateProcPtr)(WindowPtr theWindow,Boolean active); 
  30.  
  31. /* windowControl is the structure attached to every window I create (in the refCon */
  32. /* field) that contains all the information I need to know about the window. */
  33. /* data, procedure pointers for controlling, and anything else gets put in this */
  34. /* struct.  That makes my windows autonomous */
  35. struct windowControl {
  36.     unsigned long windowID;                                 /* master ID number  */
  37.     myDrawProcPtr drawMe;                                         /* content drawing procedure pointer */
  38.     myClickProcPtr clickMe;                                        /* content click routine */
  39.     myCloseProcPtr closeMe;                                        /* document close procedure pointer */
  40.     mySizeProcPtr sizeMe;                                            /* size procedure */
  41.     myActivateProcPtr activateMe;
  42.     AliasHandle fileAliasHandle;                            /* alias for this document */
  43.     Boolean windowDirty;
  44.     Handle generalData;                                        /* cast to whatever you need as you need it */
  45. };
  46. typedef struct windowControl windowControl, *windowCPtr, **windowCHandle;
  47.  
  48. struct AEinstalls {
  49.     AEEventClass theClass;
  50.     AEEventID theEvent;
  51.     EventHandlerProcPtr theProc;
  52. };
  53. typedef struct AEinstalls AEinstalls;
  54.  
  55. enum {kDocWindowResID = 128,kMyDocumentWindow = 1000};
  56. /* menu enums */
  57. enum {kMBarID = 128};
  58. enum {kAppleMenu = 128,kFileMenu,kEditMenu,kToolsMenu};
  59.  
  60. /* file menu enums */
  61. enum {kNewItem = 1,kOpenItem,kCloseItem,kSaveItem,kSaveAsItem,kFileBlank1,kPageSetupItem,kPrintItem,kFileBlank2,kQuitItem};
  62.  
  63. /* general purpose enums */
  64. enum {kResumeMask=1,kSampHelp=129,kAboutBox=128,kHelpString=128,kBadSystem=130};
  65.  
  66. enum {kMinHeight = 200};